<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <div th:replace="admin/include :: resource-header">header goes here.</div>
</head>

<body>

<div class="am-g tpl-g">
    
    <div th:replace="admin/include :: top">header goes here.</div>
    
    
    <div th:replace="admin/include :: leftmenu">left menu goes here</div>
    
    <!-- content goes here -->
    <div class="tpl-content-wrapper">
        <div class="row-content am-cf">
            <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                    <div class="widget am-cf">
                        <div class="widget-head am-cf">
                            <div class="widget-title  am-cf" th:text="${title}">添加数据</div>
                        </div>
                        
                        <div class="widget-body  am-fr">
                            
                            <div class="am-u-sm-12">
                                <form data-action="/admin/manager/doUpdate" class="am-form"
                                      id="cAdd" data-location="/admin/manager/index">
                                    <div class="am-form-group">
                                        <label class="am-form-label">用户名：</label>
                                        <input type="text" maxlength="20" name="username" th:value="${item.username}"
                                               disabled>
                                    </div>
    
                                    <div class="am-form-group">
                                        <label class="am-form-label">角色：</label>
                                        <select name="rids" multiple id="chosen-select"
                                                data-placeholder="请选择角色，可多选">
                                            <option th:each="role : ${roles}" th:value="${role.id}"
                                                    th:text="${role.name}"
                                                    th:selected="${roleIds.contains(role.id.toString())}"></option>
                                        </select>
                                    </div>
    
                                    <div class="am-form-group">
                                        <label class="am-form-label">姓名：</label>
                                        <input type="text" name="name" th:value="${item.name}" placeholder="输入姓名"
                                               required>
                                    </div>
    
                                    <div class="am-form-group">
                                        <label class="am-form-label">密码：</label>
                                        <input type="password" name="password" minlength="6" maxlength="20"
                                               placeholder="不改密码请留空" class="am-novalidate">
                                    </div>
    
                                    <div class="am-form-group">
                                        <label>状态：</label>
                                        <label th:checked="${item.enable == 1}" class="am-radio-inline">
                                            <input type="radio" value="1" name="enable" data-type="icheck" checked> 启用</label>
                                        <label th:checked="${item.enable == 0}" class="am-radio-inline">
                                            <input type="radio" value="0" name="enable" data-type="icheck"> 禁用</label>
                                    </div>
                                    
    
                                    <div class="am-form-group">
                                        <input type="hidden" name="id" th:value="${item.id}">
                                        <button type="submit" class="am-btn am-btn-primary">提交保存</button>
                                    </div>
                                    
                                </form>
                            </div>
                            
                        </div>
                    </div>
                </div>
    
                <div class="am-u-lg-12">
                    <div th:replace="admin/include :: footer">web page footer goes here.</div>
                </div>
            </div>
        </div>
    </div>
    
</div>
<th:block th:replace="admin/include :: resource-footer"></th:block>
<script>
    seajs.use("admin", function (exports) {
        
    });
    
</script>

</body>

</html>